<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo Yii::app()->name;?></title>
<base href="/" />
<?php $this->util->css($this->css);?>
<!--[if IE]> <link href="css/ie.css" rel="stylesheet" type="text/css"> <![endif]-->
<?php $this->util->js($this->head_js);?>
<style type="text/css">
.iconb { 
	font-size: 2em;
}
.widget [class*="icos-"] { float: none; }
</style>
</head>

<body>

<!-- Top line begins -->
<div id="top">
    <div class="wrapper">
        <a href="index.html" title="" class="logo"><img src="images/logo.png" alt="" /></a>
        
        <?php if (!Yii::app()->user->isGuest):?>
        <!-- Right top nav -->
        <div class="topNav">
            <ul class="userNav">
                <li><a title="搜索新闻" class="search"></a></li>
                <li><a href="/" title="首页" class="screen"></a></li>
                <li><a href="#" title="设置" class="settings"></a></li>
                <li><a href="<?php echo BASE_URL . 'logout';?>" title="退出" class="logout"></a></li>
                <li class="showTabletP"><a href="#" title="" class="sidebar"></a></li>
            </ul>
            <div class="topSearch">
                <div class="topDropArrow"></div>
                <form action="">
                    <input type="text" placeholder="search..." name="topSearch" />
                    <input type="submit" value="" />
                </form>
            </div>
        </div>
        <?php endif;?>
        <div class="clear"></div>
    </div>
</div>
<!-- Top line ends -->

<?php if (!Yii::app()->user->isGuest):?>
<!-- Sidebar begins -->
<div id="sidebar">
    <div class="mainNav">
        <div class="user">
            <a title="" class="leftUserDrop"><img src="images/user.png" alt="" /></a><span><?php echo Yii::app()->user->admin_name;?></span>
            <ul class="leftUser">
                <li><a href="#" title="" class="sSettings">设置</a></li>
                <li><a href="/logout" title="" class="sLogout">退出</a></li>
            </ul>
        </div>
        
        <!-- 主栏目 -->
        <ul class="nav">
        	<?php foreach (Yii::app()->params->nav_rights as $control => $item):?>
        		<?php 
        		if (Yii::app()->user->act_rights != '*')
        		{
        			if (!isset(Yii::app()->user->act_rights[$control]))
					{
						continue;
					}
					elseif (Yii::app()->user->act_rights[$control] != '*' && !in_array($action, Yii::app()->user->act_rights[$control]))
					{
						continue;
					}
        		}
        		?>
        		<li><a href="<?php echo BASE_URL . $control?>" <?php if ($control == $this->controller_id) echo 'class="active"';?>><img src="images/icons/mainnav/<?php if (!empty($item['icon'])) echo $item['icon']; else echo "dashboard.png"?>" alt="" /><span><?php echo $item['text'];?></span></a></li>
        	<?php endforeach;?>
        </ul>
    </div>
    
    <!-- Secondary nav -->
    <div class="secNav">
        <div class="secWrapper">
            <div class="secTop">
                <div class="balance">
                    <div class="balInfo"><?php echo Yii::app()->user->role_name;?><span><?php echo date('Y-m-d H:i:s');?></span></div>
                </div>
            </div>
            <ul class="iconsLine ic3 etabs">
				<li><a title=""></a></li>
				<li><a title=""></a></li>
				<li><a title=""></a></li>
			</ul>
            <!-- 二级栏目 -->
            <div id="tab-container" class="tab-container">
                <div id="general">
                    <ul class="subNav">
                    <?php if (isset(Yii::app()->params->nav_rights[$this->controller_id])) :?>
	                    <?php foreach (Yii::app()->params->nav_rights[$this->controller_id]['items'] as $action => $item):?>
	                        <li <?php if ($action == $this->action_id) echo 'class="activeli"';?>><a href="<?php echo BASE_URL . $this->controller_id . '/' . $action;?>" <?php if ($action == $this->action_id) echo 'class="this"';?>><span class="icos-fullscreen"></span><?php echo $item['text'];?></a></li>
	                    <?php endforeach;?>
                    <?php endif;?>
                    </ul>
                    
                    <div class="divider"><span></span></div>
                   
                </div>
            </div>
       </div> 
       <div class="clear"></div>
   </div>
</div>
<!-- Sidebar ends -->
<?php endif;?>

<?php echo $content;?>

<?php $this->util->js($this->foot_js);?>

</body>
</html>
